package nuc.lizongze.item.service.impl;

import com.netflix.discovery.converters.Auto;
import nuc.lizongze.item.service.ItemParamService;
import nuc.lizongze.mapper.TbItemParamMapper;
import nuc.lizongze.pojo.TbItemParam;
import nuc.lizongze.pojo.TbItemParamExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemParamServiceImpl implements ItemParamService {
    @Autowired
    private TbItemParamMapper tbItemParamMapper;
    @Override
    public TbItemParam selectItemParamByItemCatId(Long itemCatId) {
        TbItemParamExample example = new TbItemParamExample();
        TbItemParamExample.Criteria criteria = example.createCriteria();
        criteria.andItemCatIdEqualTo(itemCatId);
        List<TbItemParam> tbItemParams = this.tbItemParamMapper.selectByExampleWithBLOBs(example);
        if (tbItemParams != null&&tbItemParams.size()>0){
            return tbItemParams.get(0);
        }
        return null;
    }
}
